import api from '../../../utils/apijs';

export default {
  namespaced: true,
  state: {
    GjData: [],
    maxPage: 1,
  },
  actions: {
    selectGjData(context, obj) {
      return api[obj.name](obj.data).then(data => {
        context.commit('saveGjData', data.data.data);
        return data;
      });
    },
  },
  mutations: {
    saveGjData(state, data) {
      state.GjData = data.list;
      state.maxPage = data.lastPage;
    },
  },
  getters: {},
};
